Skip to content

Comments

Fix storage account connection string configuration for cpu-app#67

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-66
Draft

Fix storage account connection string configuration for cpu-app#67
Copilot wants to merge 2 commits intomainfrom
copilot/fix-66

Conversation

Copy link

Copilot AI commented Jul 17, 2025

Summary

This PR resolves the InvalidOperationException being thrown by the cpu-app when accessing the /api/app/test endpoint due to missing storage account connection string configuration.

Root Cause

The application was failing with:

System.InvalidOperationException: Storage account connection string is not configured.

This occurred because:

  1. The appsettings.json had an empty connection string: "StorageAccount": ""
  2. The infrastructure (main.bicep) didn't provision a storage account
  3. No app settings were configured to provide the connection string in production

Changes Made

Infrastructure (main.bicep)

  • Added Azure Storage Account resource with unique naming using uniqueString(resourceGroup().id)
  • Configured Web App application settings to inject the storage connection string
  • Used Standard_LRS storage with Hot access tier for cost-effectiveness

Configuration

  • Updated appsettings.json to use "UseDevelopmentStorage=true" for local development
  • Added storage configuration to appsettings.Development.json for consistency
  • Both now provide valid connection string values instead of empty strings

Testing

  • Project builds successfully without errors
  • Application starts without configuration exceptions
  • The original "Storage account connection string is not configured." error is resolved
  • Connection string is properly loaded from configuration (verified with test endpoint)

Production Impact

When deployed, the bicep template will:

  1. Create a new storage account with a unique name
  2. Automatically configure the Web App with the correct connection string
  3. Allow the /api/app/test endpoint to function properly

Fixes #66.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: mrsharm <68247673+mrsharm@users.noreply.github.com>
Copilot AI changed the title [WIP] [Azure SRE] Storage account connection string is not configured - cpu-app Fix storage account connection string configuration for cpu-app Jul 17, 2025
Copilot AI requested a review from mrsharm July 17, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Azure SRE] Storage account connection string is not configured - cpu-app

2 participants